package edu.towson.greenteam;


import edu.towson.greenteam.menu.Category;
import edu.towson.greenteam.order.Orders;
import edu.towson.greenteam.table.Tables;

public class SystemInterface {

    public Invoker i;
    public CustomerQueue customersQueue;

    public SystemInterface() {
        i = new Invoker();
        customersQueue = new CustomerQueue(i);
        customersQueue.addObserver(getOrders());
        getTables().addObserver(customersQueue);
        getTables().setCustomerQueue(customersQueue);
        getOrders().setInvoker(i);
    }

    public String getMenu() {
        return i.getMenu().toString();
    }

    public String getMenuByPrice(int price) {
        return i.getMenuByPrice(price).toString();
    }

    public String getMenuByRating(int rating) {
        return i.getMenuByRating(rating).toString();
    }

    public void addMenuItem(String name, String description, float price, int quantity,
            Category category, int prepTime) {
        i.addMenuItem(name, description, price, quantity, category, prepTime);
    }

    public String getComments() {
        return i.getComments().toString();
    }

    public void addComment(String comment, String custname) {
        i.addComment(comment, custname);
    }

    public void setOrderServed() {
        //i.setOrderServed();
    }

    private Orders getOrders() {
        return i.getOrders();
    }

    public String getOrdersQueue() {
        return i.getOrders().toString();
    }

    public void setMenuItemQuantity(int id, int quantity) {
        i.setMenuItemQuantity(id, quantity);
    }

    public void setOffer() {
        //i.setOffer(o);
    }

    public void applyOfferToTab() {
        i.applyOfferToTab();
    }

    public String getKitchenQueue() {
        return i.getKitchenQueue();
    }


    public Tables getTables() {
        return i.getTables();
    }

    public String getOccupiedTables() {
        return i.getOccupiedTables();
    }

    public String getTablesWaitingOnFoodOrder() {
        return i.getTablesWaitingOnFoodOrder();
    }

    public void setPin(int pin) {
        i.setPin(pin);
    }

    public String getTable() {
        return i.getTable();
    }

    public void addItemRating(int id, int rating) {
        i.addItemRating(id, rating);
    }

    public void setTabPayment() {
        i.setTabPayment();
    }

    public String getCustomersQueue() {
        return customersQueue.toString();
    }
    
    public String getTablesforUI() {
    	return i.getTables().toString();
    }
}
